package com.googlecode.gingerman.world;

import java.util.ArrayList;
import java.util.List;
import com.googlecode.gingerman.robot.Bullet;
import com.googlecode.gingerman.robot.Robot;

public class World {

	private double width, height;
	private List<Wall> walls = new ArrayList<Wall>();
	private List<Robot> robots = new ArrayList<Robot>(); 
	private List<Robot> robots_del = new ArrayList<Robot>();
	private List<Bullet> bullets = new ArrayList<Bullet>(); 
	private List<Bullet> bullets_tmp_add = new ArrayList<Bullet>();
	private List<Bullet> bullets_tmp_del = new ArrayList<Bullet>();

	public World(double width, double height) {
		this.height = height;
		this.width = width;
	}

	public void clear() {
		robots.removeAll(robots);
		bullets.removeAll(bullets);
		walls.removeAll(walls);
	} 
	
	public double getWidth() {
		return width;
	}

	public double getHeight() {
		return height;
	}

	public void addRobot(Robot robot) {
		robots.add(robot);
		robot.setWorld(this);
	} 
	
	public void addRobotDel(Robot robot_del) {
		robots_del.add(robot_del);
		robot_del.setWorld(this);
	}

	public void addBullet(Bullet bullet) {
		bullets.add(bullet);
		bullet.setWorld(this);
	}
	
	public void addBulletTmpAdd(Bullet bullet_tmp_add) {
		bullets_tmp_add.add(bullet_tmp_add);
		bullet_tmp_add.setWorld(this);
	}
	
	public void addBulletTmpDel(Bullet bullet_tmp_del) {
		bullets_tmp_del.add(bullet_tmp_del);
		bullet_tmp_del.setWorld(this);
	}

	public void addWall(Wall wall) {
		walls.add(wall);
	} 
	
	public List<Robot> getRobots() {
		return robots;
	}
	
	public List<Robot> getRobotsDel() {
		return robots_del;
	}
	
	public List<Wall> getWalls() {
		return walls;
	}

	public List<Bullet> getBullets() {
		return bullets;
	}
	
	public List<Bullet> getBulletsTmpAdd() {
		return bullets_tmp_add;
	}
	
	public List<Bullet> getBulletsTmpDel() {
		return bullets_tmp_del;
	}
	

}